<template>  
  <div>
    <MySearch :formItems="formItems" @search="search" :maxShow="6">  
      <template v-slot:custom-slot="{ data }">  
        <!-- 自定义内容 -->  
        <el-input  
          v-if="data.type === 'customType'"  
          v-model="form[data.prop]"  
          placeholder="自定义输入"  
        ></el-input>  
      </template>  
    </MySearch>  
  </div>
</template>  

<script>
import MySearch from '@/components/mySearch'
export default {
  data () {
    return {
      formItems: [  
        { label: '用户名', prop: 'username', type: 'el-input' },  
        { label: '用户名', prop: 'usernames', type: 'el-input' },  
        { label: '用户名', prop: 'usernames', type: 'el-input' },  
        { label: '用户名', prop: 'usernames', type: 'el-input' },  
        { label: '用户名', prop: 'usernames', type: 'el-input' },  
        { label: '选择类型', prop: 'type1', type: 'el-select', options: [{ value: 'option1', label: '选项1' }, { value: 'option2', label: '选项2' }] },  
        // { label: '自定义', prop: 'custom', type: 'customType', slot: 'custom-slot' },  
      ],  
      form: {}  
    }
  },
  components: {
    MySearch
  },
  created() {
  },
  mounted() {

  },
  methods: {
    search(form) {
      console.log("🚀 ~ search ~ form:", form)
    }
  },
}

</script>
<style scoped lang='less'>

</style>